package cn.iocoder.yudao.framework.datasource.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.hy.corecode.idgen.WFGIdGenerator;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: 王富贵
 * @description: mp拦截器用于注入id请求
 * @createTime: 2023/4/23 9:40
 */
@Component
public class CustomIdGenerator implements IdentifierGenerator {

    @Resource
    private WFGIdGenerator wFGIdGenerator;

    @Override
    public Long nextId(Object entity) {
        return wFGIdGenerator.next();
    }
}